<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹窗示例</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            height: 100%;

            -webkit-user-select:none;
            -moz-user-select:none;
            -ms-user-select:none;
            user-select:none;
        }
        body{
            display: flex;
            flex-direction: column;
        }
        button{
            width: fit-content;
            display: block;
            box-sizing: border-box;
            padding: 0 10px;
            margin: 10% auto;
            cursor: pointer;
        }
        /*弹窗样式*/
        .zhezhao{
            /*
            border: 1px solid red;*/
            position: fixed;
            width: 100%;
            height: 100%;
            background-color: #00000069;
            /**/
            display: none;
            /*
            display: flex;*/
            justify-content: center;
            align-items: center;
        }
        .tanchuang{
            /*
            border: 1px solid red;*/
            display: flex;
            flex-direction: column;
            width: 563px;
            height: 250px;




            background-image: url(https://www.gacmotor.com/gs4/images/banner_pc.jpg);
            background-repeat: no-repeat;
            background-position: top;
            background-size: contain;


            cursor: pointer;










            animation: tada; /* referring directly to the animation's @keyframe declaration */
            animation-duration: 1s; /* don't forget to set a duration! */

        }








        .head{
            /*
            border: 1px solid red;*/
            display: flex;
            width: 100%;
            height: 25px;
            background-color: #ffffff00;
            justify-content: right;
        }
        .close{
            /*
            border: 1px solid red;*/
            width: 25px;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 20px;
            cursor: pointer;
            color: #0000006b;




            
        }
        .close:hover{
            background-color: #df0000;
            color: #fff;
        }
        .tbody{
            /*
            border: 1px solid green;*/
            flex: 1;
            
        }
    </style>
</head>
<body>
    <button onclick="tanchuang1()" title="点击展开弹窗">弹窗</button>
    <!-- 弹窗部分 -->
    <div class="zhezhao">
        <div class="tanchuang animate__animated animate__tada">
            <div class="head">
                <div class="close" onclick="closeTanchuang1()">×</div>
            </div>
            <div class="tbody"></div>
        </div>
    </div>

    <script>
        var zhezhao=document.getElementsByClassName("zhezhao")[0]
        var tanchuang=document.getElementsByClassName("tanchuang")[0]
        function tanchuang1(){
            zhezhao.style.display='flex'
            //tanchuang.style.setProperty('--animate__tada', '2s');
            
        }
        function closeTanchuang1(){
            zhezhao.style.display='none'
        }
    </script>
</body>
</html>
